package com.ruoyi.chat.controller;

import com.ruoyi.chat.domain.RequestDto;
import com.ruoyi.chat.service.ITbChatService;
import com.ruoyi.chat.service.impl.TbChatServiceImpl;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/aichat")
public class AiController extends BaseController {

    @Autowired
    private ITbChatService chatService;

    @PostMapping("/chatList")
    public AjaxResult chatList() {
        return AjaxResult.success("操作成功", chatService.getChatList());
    }

    @PostMapping("/chat")
    public AjaxResult chat(@RequestBody RequestDto requestDto) {
        return AjaxResult.success("操作成功", chatService.chat(requestDto));
    }


}
